#!usr/bin/env python3
# coding=utf-8
import random
initarrays = [0 for i in range(0, 100)]
numbers = [random.randint(1, 99) for i in range(1, 10)]
print(numbers)
for i in numbers:
    initarrays[i] = initarrays[i] + 1
for i in range(0, 100):
    if initarrays[i] > 0:
        for j in range(0, initarrays[i]):
            print(i)

num1 = [random.randint(1, 99) for i in range(1, 40)]
print(num1)
for i in range(0, 39):
    for j in range(i + 1, 39):
        if num1[i] > num1[j]:
            tmp = num1[i]
            num1[i] = num1[j]
            num1[j] = tmp
print(num1)

num2 = [random.randint(1, 1000) for i in range(1, 101)]
print(num2)


def quicksort(left, right):
    if left > right:
        return
    t = num2[left]
    i = left
    j = right
    while i != j:
        while num2[j] >= t and j > i:
            j = j - 1
        while num2[i] <= t and j > i:
            i = i + 1
        if i < j:
            tmp = num2[i]
            num2[i] = num2[j]
            num2[j] = tmp
    num2[left] = num2[i]
    num2[i] = t
    quicksort(left, i - 1)
    quicksort(i + 1, right)

quicksort(0, 99)
print(num2)
